<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>get2</title>
    <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
</head>
<body>
<div id="case8-demo1">
    <input type="text" v-model="github">
    <button v-on:click="sendGet">输出</button>
    <div v-for="avatar_url in info">
        <img v-bind:src="avatar_url">
    </div>

</div>
<script type="text/javascript">
    var case8Demo=new Vue({
        el:"#case8-demo1",
        data:{
            info:null,
            github:""
        },
        methods:{
            sendGet:function () {
                axios
                .get("https://api.github.com/user/"+case8Demo.github)
                .then(response=>(
                    case8Demo.info=response.data,
                    console.log(response.data)))
                .catch(function (error) {
                    console.log(error)
                })
            }
        }
    })
</script>
</body>
</html>